﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LightSwitch;
namespace LightSwitchApplication
{
    public partial class EmrData
    {
        private String FormatName(String name)
        {
            name = name.Trim();
            return name.Substring(0, 1).ToUpper() + name.Substring(1).ToLower();
        }

        partial void PhysicianFirstName_Changed()
        {
            if (this.PhysicianFirstName != null)
                this.PhysicianFirstName = FormatName(this.PhysicianFirstName);
        }

        partial void PhysicianLastName_Changed()
        {
            if (this.PhysicianLastName != null)
                this.PhysicianLastName = FormatName(this.PhysicianLastName);
        }

        partial void MedicalName_Changed()
        {
            if (this.MedicalName != null)
                this.MedicalName = this.MedicalName.ToUpper();
        }

        partial void CommercialName_Changed()
        {
            if (this.CommercialName != null)
                this.CommercialName = this.CommercialName.ToUpper();
        }

        partial void PatientFirstName_Changed()
        {
            if (this.PatientFirstName != null)
                this.PatientFirstName = FormatName(this.PatientFirstName);
        }

        partial void PatientLastName_Changed()
        {
            if (this.PatientLastName != null)
                this.PatientLastName = FormatName(this.PatientLastName);
        }


    }
}
